package com.example.kyyl.greendao;

import com.clj.fastble.data.BleDevice;
import com.google.gson.Gson;

import org.greenrobot.greendao.converter.PropertyConverter;

/**
 * @ProjectName: KYYL
 * @Package: com.example.kyyl.greendao
 * @ClassName: Temp_Converter
 * @Description: java类作用描述
 * @CreateDate: 2021/6/1 0001 10:22
 * @UpdateUser: 更新者：
 * @UpdateDate: 2021/6/1 0001 10:22
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public class BleDevice_Converter implements PropertyConverter<BleDevice, String> {
    @Override
    public BleDevice convertToEntityProperty(String databaseValue) {
        return new Gson().fromJson(databaseValue, BleDevice.class);
    }

    @Override
    public String convertToDatabaseValue(BleDevice entityProperty) {
        return new Gson().toJson(entityProperty);
    }
}